vm-event: proper vCPU-paused checks at resume
A VM_EVENT_FLAG_VCPU_PAUSED flag in a vm-event response should only be treated
as informative that the toolstack user wants the vm-event subsystem to unpause
the target vCPU, but not be relied upon to decide if the target vCPU is actually
paused.
That being said, this patch does the following:
* Fixes (replaces) the old behavior in vm_event_resume, which relied on
VM_EVENT_FLAG_VCPU_PAUSED to determine if the target vCPU is paused, by
actually checking the vCPU vm-event pause-count.
* ASSERTs that the vCPU is paused in vm_event_set_registers and
vm_event_toggle_singlestep.
* Ignores VM_EVENT_FLAG_DENY @ vm_event_register_write_resume if the target vCPU
is not paused. Also adjusts comment in public/vm_event.h to reflect that.
Signed-off-by: Corneliu ZUZU <czuzu@bitdefender.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
Acked-by: Tamas K Lengyel <tamas@tklengyel.com>